<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
  <head>
    <title>role query</title>
    <base href="<%=basePath%>/">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1";/><!-- IE的渲染模式 -->
    <meta name="keywords" content="信帧,teleframe,iparking,I停车,爱停车,blackshadowwalker" />
	<meta name="description" content="信帧,teleframe,iparking,I停车,爱停车,blackshadowwalker" />
	<meta name="author" content="blackshadowwalker" />
	
	<link href="bootstrap/3/css/bootstrap.css" rel="stylesheet"/>
	<link href="index/css/justified-nav.css" rel="stylesheet">
	<link href="css/common.css" rel="stylesheet" >

	<script src="scripts/jquery/jquery-1.7.min.js"></script>
	<script src="bootstrap/3/js/bootstrap.min.js"></script>
	<link href="bootstrap/3/css/datepicker.css" rel="stylesheet"/>
	<script src="bootstrap/3/js/bootstrap-datepicker.js"></script>

	<script type="text/javascript">
		var msg = "${msg}";
		if(msg!="")
			alert(msg);
			
		function del(id){
			if(confirm("确定删除吗？"))
				location.href="<%= basePath%>/RoleAction?method=delete&roleInfo.roleId="+id;
		}
	</script>
	<style>
		body{
			margin-left: 10px;
			margin-top: 7px;
			width:98%;
			min-width:500px;
		}
	</style>
	
  </head>
  
  <body >
  
  	<div>
		<div class="alert-info" style="">
			<s:if test="#request.add>0">
				 <a href="${action }?method=add" style="color:#fff;"  class="btn btn-success " >
					添加角色
				</a>
			</s:if>
			<div style="display:inline;margin-left:30px;color:#f00;">
				${msg }
			</div>
		</div >
	</div>
						
	<table class="table  table-hover" style="width:99%;">
	
		<tr >
			<th width="" class="hidden">序号</th>
			<th ondblclick="return sortQuery('carNumber')" style="cursor:pointer;" >角色名称</th>
			<th ondblclick="return sortQuery('carNumber')" style="cursor:pointer;" >角色标志</th>
			<th ondblclick="return sortQuery('carName')" style="cursor:pointer;" >最后更新时间</th>
            <th colspan="2" align="center">操作</th> 
        </tr>
        <s:iterator id="l"  value="list" status="index">  
			<tr  >
				<td class="hidden"><s:property value="#l.roleId" /></td>
				<td ><s:property value="#l.roleName" /></td>
				<td ><s:property value="#l.flagName" /></td>
				<td ><s:date name="#l.lastUpdate" format="yyyy-MM-dd hh:mm:ss" /></td>
				<td >
					<s:if test="#request.delete>0 && #l.flag>0">
						<a  class="btn btn-danger" onclick="javaScript:del(<s:property value='#l.roleId' />);" title="删除">
							<span class="glyphicon glyphicon-trash"></span>
						</a>
					</s:if>
              	 	<s:if test="#request.update>0 ">
              	 		<a class="btn btn-info"  href="${action}?method=update&id=${roleId}" title="修改">
              	 			<span class="glyphicon glyphicon-edit"></span>
              	 		</a>
              	 	</s:if>	
                </td>
             </tr>
        </s:iterator>
		
	</table>
						
  </body>
</html>
